package com.couldsail.takeaway.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("orders")
@Schema(description = "订单实体")
public class Orders {
    @Schema(description = "主键")
    private String id;
    
    @Schema(description = "订单号")
    private String number;
    
    @Schema(description = "订单状态 1待付款 2待接单 3已接单 4派送中 5已完成 6已取消 7退款")
    private Integer status;
    
    @Schema(description = "下单用户")
    private String userId;
    
    @Schema(description = "地址id")
    private String addressBookId;
//    @JsonFormat(pattern = "yyyy-MM-dd")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @Schema(description = "下单时间")
    private LocalDateTime orderTime;
    
    @Schema(description = "结账时间")
    private LocalDateTime checkoutTime;
    
    @Schema(description = "支付方式 1微信,2支付宝3-现金")
    private Integer payMethod;
    
    @Schema(description = "支付状态 0未支付 1已支付 2退款")
    private Integer payStatus;
    
    @Schema(description = "实收金额")
    private BigDecimal amount;
    
    @Schema(description = "优惠券编号")
    private String vouchers;
    
    @Schema(description = "备注")
    private String remark;

    @Schema(description = "桌号")
    private String seatNums;

    @Schema(description = "1 外卖 0 堂食")
    private Integer seatStatus;

    @Schema(description = "店铺id")
    private String shopId;

    @Schema(description = "手机号")
    private String phone;
    
    @Schema(description = "地址")
    private String address;
    
    @Schema(description = "用户名称")
    private String userName;
    
    @Schema(description = "收货人")
    private String consignee;
    
    @Schema(description = "订单取消原因")
    private String cancelReason;
    
    @Schema(description = "订单拒绝原因")
    private String rejectionReason;
    
    @Schema(description = "订单取消时间")
    private LocalDateTime cancelTime;
    
    @Schema(description = "预计送达时间")
    private LocalDateTime estimatedDeliveryTime;
    
    @Schema(description = "配送具体时间")
    private Integer delivery;
    
    @Schema(description = "送达时间")
    private LocalDateTime deliveryTime;
    
    @Schema(description = "打包费")
    private Integer packAmount;
    
    @Schema(description = "餐具数量")
    private Integer tablewareNumber;

} 